﻿using BW.WMS.Application.Features.User.Dtos;
using BW.WMS.Application.Features.User.Interfaces;
using BW.WMS.Core.Result;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace BW.WMS.API.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class UserController : ControllerBase
    {
        private readonly IUserServices userServices;
        public UserController(IUserServices userServices)
        {
            this.userServices = userServices;
        }
        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="username"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        [HttpPost]
        public ApiResult<UserDtos> Login([FromBody]InputUserDtos inputUserDtos)
        {
           return userServices.Login(inputUserDtos);
        }
    }
}
